package com.ljxt.dt.service.basicinformationservice.impl;

import com.ljxt.dt.dao.basicinformationdao.SupplierDao;
import com.ljxt.dt.dao.basicinformationdao.impl.SupplierDaoImpl;
import com.ljxt.dt.domain.GoodsInfo;
import com.ljxt.dt.domain.SupplierInfo;
import com.ljxt.dt.domain.SupplierType;
import com.ljxt.dt.service.basicinformationservice.SupplierListService;
import com.ljxt.dt.vo.basicInformation.GoodsInfoVO;
import com.ljxt.dt.vo.basicInformation.SupplierListVO;

import java.util.List;

/**
 * @author 糖糖
 * @version 1.0.0
 * @date 2020/5/12 14:41
 * @copyright 老九学堂
 */
public class SupplierListServiceImpl implements SupplierListService {

    private SupplierDao supplierDao = new SupplierDaoImpl();

    @Override
    public List<SupplierInfo> findAllSuppliers() {
        return supplierDao.findAllSuppliers();
    }

    @Override
    public List<SupplierListVO> findAll(Integer currentIndex, Integer pageSize, String supplierName, Integer typeId, Integer id) {
        return supplierDao.findAll(currentIndex, pageSize, supplierName, typeId, id);
    }

    @Override
    public List<SupplierType> selectSupplierType() {
        return supplierDao.selectSupplierType();
    }

    @Override
    public int selectCount(int currentIndex, int pageSize, String supplierName, int typeId, int id) {
        return supplierDao.selectCount(currentIndex, pageSize, supplierName, typeId, id);
    }

    @Override
    public List<GoodsInfoVO> findALLGoods(int id, String goodsName, int currentIndex, int pageSize) {
        return supplierDao.findAllGoods(id, goodsName,currentIndex, pageSize);
    }

    @Override
    public int findALLGoodsCount(int id, String goodsName, int currentIndex, int pageSize) {
        return supplierDao.findAllGoodsCount(id, goodsName,currentIndex, pageSize);
    }

    @Override
    public boolean addNewSupplier(int id, String typeName, String address, String contactName, String phone, String[] goodsIdArray) {
        return supplierDao.addNewSupplier(id, typeName, address, contactName, phone, goodsIdArray);
    }

    @Override
    public List<GoodsInfoVO> findSupplierGoods(int id) {
        return supplierDao.findSupplierGoods(id);
    }

    @Override
    public boolean updateSupplier(int id,int typeId, String supplierName, String address, String contactName, String phone, String[] goodsIdArray) {
        return supplierDao.updateSupplier(id,typeId, supplierName, address, contactName, phone, goodsIdArray);
    }
}
